﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="ihongma.Web.UI.Page.index" ValidateRequest="false" %>
<%@ Import namespace="System.Collections.Generic" %>
<%@ Import namespace="System.Text" %>
<%@ Import namespace="System.Data" %>
<%@ Import namespace="ihongma.Common" %>

<script runat="server">
override protected void OnInit(EventArgs e)
{

	/* 
		This page was created by ihongma Template Engine at 2014/4/21 20:17:47.
		本页面代码由ihongma模板引擎生成于 2014/4/21 20:17:47. 
	*/

	base.OnInit(e);
	StringBuilder templateBuilder = new StringBuilder(220000);
	templateBuilder.Append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>修改收货信息窗口</title>\r\n<script type=\"text/javascript\" src=\"../../scripts/jquery/jquery-1.10.2.min.js\"></");
	templateBuilder.Append("script>\r\n<script type=\"text/javascript\" src=\"../../scripts/lhgdialog/lhgdialog.js?skin=idialog_1\"></");
	templateBuilder.Append("script>\r\n<script type=\"text/javascript\" src=\"../../scripts/jquery/PCASClass.js\"></");
	templateBuilder.Append("script>\r\n<script type=\"text/javascript\" src=\"../../admin/js/layout.js\"></");
	templateBuilder.Append("script>\r\n<link href=\"../../admin/skin/default/style.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n<script type=\"text/javascript\" src=\"http://api.map.baidu.com/api?v=2.0&ak=OYonZmtvxwM2fzf71C3rrZvB&services=&t='+(new Date()).getTime()\"></");
	templateBuilder.Append("script>\r\n<script src=\"");
	templateBuilder.Append("/templates/JuiceUp");
	templateBuilder.Append("/js/GeoUtils_min.js\"></");
	templateBuilder.Append("script>\r\n\r\n\r\n\r\n<script type=\"text/javascript\">\r\n    //窗口API\r\n    var myGeo = new BMap.Geocoder();\r\n\r\n    pts = [new BMap.Point(116.230249, 39.995418),\r\nnew BMap.Point(116.215302, 39.881233),\r\nnew BMap.Point(116.232549, 39.848448),\r\nnew BMap.Point(116.269344, 39.815646),\r\nnew BMap.Point(116.284292, 39.781054),\r\nnew BMap.Point(116.311887, 39.783716),\r\nnew BMap.Point(116.377428, 39.77928),\r\nnew BMap.Point(116.399275, 39.76242),\r\nnew BMap.Point(116.438369, 39.789038),\r\nnew BMap.Point(116.488961, 39.812099),\r\nnew BMap.Point(116.525756, 39.832492),\r\nnew BMap.Point(116.555652, 39.853765),\r\nnew BMap.Point(116.547603, 39.943218),\r\nnew BMap.Point(116.487812, 40.017524),\r\nnew BMap.Point(116.440669, 40.024597),\r\nnew BMap.Point(116.341783, 40.025481),\r\nnew BMap.Point(116.283142, 40.013988),\r\nnew BMap.Point(116.2291, 39.997186)];\r\n    var ply = new BMap.Polygon(pts);\r\n    var fild = 0;\r\n    var api = frameElement.api, W = api.opener;\r\n    api.button({\r\n        name: '确定',\r\n        focus: true,\r\n        callback: function () {\r\n            submitForm();\r\n            return false;\r\n        }\r\n    }, {\r\n        name: '取消',\r\n        callback: function () {\r\n            location.reload(true);\r\n        }\r\n    });\r\n\r\n    //页面加载完成执行\r\n    $(function () {\r\n        new PCAS(\"txtProvince\", \"txtCity\", \"txtArea\", \"北京市\");\r\n      \r\n  \r\n       \r\n//        //初始化省市区\r\n//        var areaArr = $(\"#spanArea\", W.document).text().split(\",\");\r\n//        if (areaArr.length == 3) {\r\n//            new PCAS(\"txtProvince\", \"txtCity\", \"txtArea\", areaArr[0], areaArr[1], areaArr[2]);\r\n//        } else {\r\n//            new PCAS(\"txtProvince\", \"txtCity\", \"txtArea\");\r\n//        }\r\n//        $(\"#txtAcceptName\").val($(\"#spanAcceptName\", W.document).text());\r\n//        $(\"#txtAddress\").val($(\"#spanAddress\", W.document).text());\r\n//        $(\"#txtPostCode\").val($(\"#spanPostCode\", W.document).text());\r\n//        $(\"#txtMobile\").val($(\"#spanMobile\", W.document).text());\r\n//        $(\"#txtTelphone\").val($(\"#spanTelphone\", W.document).text());\r\n  });\r\n\r\n    //提交表单处理\r\n    function submitForm() {\r\n        //验证表单\r\n      \r\n        if ($(\"#txtAcceptName\").val() == \"\") {\r\n            W.$.dialog.alert('请填写收货人姓名！', function () { $(\"#txtAcceptName\").focus(); }, api);\r\n            return false;\r\n        }\r\n        if ($(\"#txtArea\").val() == \"\") {\r\n            W.$.dialog.alert('请选择所在地区！', function () { $(\"#txtProvince\").focus(); }, api);\r\n            return false;\r\n        }\r\n        if ($(\"#txtAddress\").val() == \"\") {\r\n\r\n           \r\n\r\n\r\n            \r\n            W.$.dialog.alert('请填写详细的送货地址！', function () { $(\"#txtAddress\").focus(); }, api);\r\n            return false;\r\n        }\r\n         if ($(\"#txtPostCode\").val() == \"\") {\r\n\r\n\r\n\r\n\r\n\r\n            W.$.dialog.alert('请填写邮政编码！', function () { $(\"#txtAddress\").focus(); }, api);\r\n            return false;\r\n        }\r\n        if ($(\"#txtMobile\").val() == \"\" && $(\"#txtTelphone\").val() == \"\") {\r\n            W.$.dialog.alert('请填写联系手机！', function () { $(\"#txtMobile\").focus(); }, api);\r\n            return false;\r\n        }\r\n        //下一步，AJAX提交表单\r\n        var postData = {\r\n            \"order_no\": $(\"#spanOrderNo\", W.document).text(), \"edit_type\": \"edit_accept_info\",\r\n            \"accept_name\": $(\"#txtAcceptName\").val(), \"province\": $(\"#txtProvince\").val(),\r\n            \"city\": $(\"#txtCity\").val(), \"area\": $(\"#txtArea\").val(), \"address\": $(\"#txtAddress\").val(),\r\n            \"post_code\": $(\"#txtPostCode\").val(), \"mobile\": $(\"#txtMobile\").val(), \"telphone\": $(\"#txtTelphone\").val(), status: $('input:radio[name=\"status\"]:checked').val(),\"field1\":fild\r\n        };\r\n        //发送AJAX请求\r\n        W.sendAjaxUrl(api, postData, \"../../tools/submit_ajax.ashx?action=accept_address_add\");\r\n        return false;\r\n    }\r\n    \r\n\r\n\r\n    \r\n\r\n  \r\n    \r\n    //;\r\n    \r\n    \r\n\r\n\r\n</");
	templateBuilder.Append("script>\r\n</head>\r\n\r\n<body><div id=\"container\" style=\"display:none; height:0px; width:0px;\">\r\n\r\n</div>\r\n<div class=\"div-content1\">\r\n    <dl>\r\n      <dt>收件人姓名</dt>\r\n      <dd><input type=\"text\" id=\"txtAcceptName\" class=\"input txt\" /> <span class=\"Validform_checktip\">*</span></dd>\r\n    </dl>\r\n    <dl>\r\n      <dt>所属省市</dt>\r\n      <dd>\r\n        <select id=\"txtProvince\"  disabled=\"disabled\" name=\"txtProvince\" class=\"select\"></select>\r\n        <select id=\"txtCity\" name=\"txtCity\" class=\"select\"></select>\r\n        <select id=\"txtArea\" name=\"txtArea\" class=\"select\"></select>\r\n      </dd>\r\n    </dl>\r\n    <dl>\r\n      <dt>详细地址</dt>\r\n      <dd><input type=\"text\" id=\"txtAddress\" class=\"input normal1\"  onblur=\"ptOutPolygon1()\"/> <span class=\"Validform_checktip\">*</span><a href=\"javascript:void(0)\"  onclick=\"ptOutPolygon();\">验证地址</a></dd>\r\n    </dl>\r\n    <dl>\r\n      <dt>邮政编码</dt>\r\n      <dd><input type=\"text\" id=\"txtPostCode\" class=\"input txt\" /></dd>\r\n    </dl>\r\n    <dl  >\r\n      <dt>联系手机</dt>\r\n      <dd><input type=\"text\" id=\"txtMobile\" class=\"input txt\" /> <span class=\"Validform_checktip\">*</span></dd>\r\n    </dl>\r\n    <dl style=\"display:none\">\r\n      <dt>联系电话</dt>\r\n      <dd><input type=\"text\" id=\"txtTelphone\" class=\"input txt\" /></dd>\r\n    </dl>\r\n      <dl>\r\n      <dt>默认地址</dt>\r\n      <dd  >\r\n          <input id=\"status\" name=\"status\" type=\"radio\" checked=checked value=\"1\" />是<input id=\"status1\" type=\"radio\" name=\"status\" value=\"0\" />否</dd>\r\n    </dl>\r\n</div>\r\n<script>\r\n\r\n\r\n\r\n    function ptOutPolygon1() {\r\n\r\n        var keyword = $(\"#txtAddress\").val();\r\n        if (keyword == \"\") {\r\n            return;\r\n        }\r\n        myGeo.getPoint(keyword, function (poi) {\r\n            if (poi) {\r\n\r\n                var result = BMapLib.GeoUtils.isPointInPolygon(poi, ply);\r\n                if (result == false) {\r\n                    \r\n                     fild = 50;\r\n                }\r\n                else {\r\n                    fild = 0;\r\n                }\r\n\r\n\r\n            }\r\n            else {\r\n                fild = 0;\r\n            }\r\n            return poi;\r\n        }, \"北京\");\r\n\r\n    }\r\n   \r\n\r\n    function ptOutPolygon() {\r\n\r\n        var keyword = $(\"#txtAddress\").val();\r\n        if (keyword == \"\") {\r\n            return;\r\n        }\r\n        myGeo.getPoint(keyword, function (poi) {\r\n            if (poi) {\r\n\r\n                var result = BMapLib.GeoUtils.isPointInPolygon(poi, ply);\r\n                if (result == false) {\r\n                    W.$.dialog.tips(\"您的地址在五环外，订购时需加收50元！\", 4, \"32X32/succ.png\");\r\n                  //  W.$.dialog.alert('', function () { $(\"#txtAddress\").focus(); }, api);\r\n                    return false;\r\n                    // fild = 0;\r\n                }\r\n                else {\r\n                    W.$.dialog.tips(\"您的地址是五环内\", 4, \"32X32/succ.png\");\r\n                   // W.$.dialog.alert('您的地址是五环内', function () { $(\"#txtAddress\").focus(); }, api);\r\n                    return false;\r\n                }\r\n\r\n\r\n            }\r\n            else {\r\n                W.$.dialog.alert('请输入正确的地址！', function () { $(\"#txtAddress\").focus(); }, api);\r\n                return false;\r\n            }\r\n            return poi;\r\n        }, \"北京\");\r\n        \r\n    }\r\n</");
	templateBuilder.Append("script>\r\n</body>\r\n</html>");
	Response.Write(templateBuilder.ToString());
}
</script>
